package com.unnous.framework;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * unnous
 * 2018/9/30
 */
@SpringBootApplication //加上该值 (exclude= {DataSourceAutoConfiguration.class}) 将不能扫描到mapper映射的包 MapperScan没有效果 报Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required异常
@ComponentScan(basePackages = {"com.unnous"})
@MapperScan(basePackages = {"com.unnous.*.dao"})
@EnableTransactionManagement // 如果mybatis中service实现类中加入事务注解，需要此处添加该注解
public class NousApplication {

    public static void main(String[] args) {
        SpringApplication.run(NousApplication.class, args);
    }
}
